﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

// qt headers
#include <QObject>

// custom headers
#include "GcsService.h"


class QNetworkReply;

namespace gmepgcs
{
    class GCS_SERVICE_EXPORTS CustomReplyBase : public QObject
    {
        Q_OBJECT

    public:
        explicit CustomReplyBase(QObject *parent= nullptr);
        virtual ~CustomReplyBase();
        
    public:
        void SetReply(QNetworkReply *pReply);
        std::wstring Error() const;

    signals:
        void Finished();

    protected:
        virtual void PrivateHandleReply();

    private slots:
        void HandleReply();      

    protected:
        QNetworkReply *m_pReply;
        std::wstring m_errorMessage;
    };
}